package com.changgou.business.init;

import com.changgou.business.service.AdService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Project: com.changgou.business.init
 * @Author: ShaoDi Wang
 * @Date: Created in 2019-07-29 00:14
 * @Description:
 * @Version: 1.0
 */
@Component
public class Init implements InitializingBean {

    @Autowired
    private AdService adService;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("运营微服务启动");
        // 所有的广告位都放在这里
        String[] positionList = {"web_index_lb"};
        for (String position : positionList) {
            adService.updateToRedis(position);
        }
    }
}